clear all;
close all;
clc;

X=[0 1 0 1; 0 0 1 1];
%OR
y = [-1 1 1 1];
[w,i] = perco(X,y,1000);
plotData (X,y);
plotLineFromWeight(w);
axis([0 1 0 1]);
title ('OR');

%AND
y = [-1 -1 -1 1];
[w,i] = perco(X,y,1000);
plotData (X,y);
plotLineFromWeight(w);
axis([0 1 0 1]);
title ('AND');

%XOR
y = [-1 1 1 -1];
[w,i] = perco(X,y,1000);
plotData (X,y);
plotLineFromWeight(w);
axis([0 1 0 1]);
title ('XOR');